Computer systems typically utilize a software layered approach for implementing communication frameworks where a layer is a program module for processing different portions of data transmitted from a producer to a consumer. The software layered approach requires examination of data by each layer (e.g., a socket layer, a TCP layer, an IP security layer, a firewall layer, an IP layer, etc.) to determine if any processing needs to be performed by that layer before sending the data to the next layer. This examination process is done through all layers and typically requires computer instructions and data to be read and processed by a central processing unit(s) (CPU), thereby consuming CPU cycles and therefore time. In many cases, even if a given layer or “module” is not enabled for the data channel, the data packet of the channel is still examined by the module to determine if processing by that module is needed. Thus, a strictly layered approach to a communication framework processes data packets through stacked layers even if some of the layers are not applicable to the data packet.
One type of conventional framework utilizes a layered approach to build communication services; examples being a protocol stack or a terminal interface. Implementing protocol processing code as a layer allows great flexibility in writing code and delivering packets to the next layer by means of common entry points into the layer. In a conventional approach, a layer registers an entry point which is a common function called to handle any incoming packets. The layer then needs to examine the packet header and the internal connection state structure to decide which function actually needs to process the packet. In a protocol like TCP which is a stateful protocol, looking at the current state and the packet header determines how the packet is going to be processed. Since the number of states possible for a TCP connection are many and the packet header can have many flags, a significant number of instruction are required to figure out the correct function to process an incoming packet.